#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import ${package}.client.rpc.YahooRemoteServiceAsync;

public class UpdatePanel extends Composite {

	private static UpdatePanelUiBinder uiBinder = GWT
			.create(UpdatePanelUiBinder.class);

	interface UpdatePanelUiBinder extends UiBinder<Widget, UpdatePanel> {
	}

	@UiField
	Button updateButton;
	
	@UiField
	HorizontalPanel updateButtonPanel;

	@UiField
	TextArea textArea;
	private YahooRemoteServiceAsync mService;

	public UpdatePanel(YahooRemoteServiceAsync pService) {
		mService = pService;
		initWidget(uiBinder.createAndBindUi(this));
		updateButtonPanel.setCellHorizontalAlignment(updateButton, VerticalPanel.ALIGN_RIGHT);
	}

	@UiHandler("updateButton")
	void onClick(ClickEvent e) {
		updateButton.setEnabled(false);
	/*	mService.updateTweet(textArea.getText(), new OAuthAsnyCallBack<YahooModel>() {
			
			public void onSuccess(YahooModel result) {
				Window.alert("Update success");
				
			}				
		});
	*/	updateButton.setEnabled(true);
	}

}
